package day01;

import java.util.List;

/**
 * @author feng
 * @Date 2021/9/22 6:55
 *    数组元素反转
 */
public class ArrayReverse {
    public static void main(String[] args) {
        int[] list = {10,20,30,40,50};
        int[] result01 = reverse(list);
        for (int i = 0; i <result01.length ; i++) {
            System.out.println(result01[i]);
        }
    }

    public static int[] reverse(int[] list){
        System.out.println(list.length);
       int[] result = new int[list.length];
       // 数组的反转
        for (int i = 0,j = list.length-1; i<list.length; i++,j--) {
                result[j] = list[i] ;
        }
        return result ;
    }



}
